//
//  NSMutableDictionary+YHSafe.m
//  YHCategory
//
//  Created by MacBook on 2023/4/4.
//

#import "NSMutableDictionary+XMSafe.h"

@implementation NSMutableDictionary (XMSafe)

- (void)safeSetObject:(id _Nonnull)object forKey:(NSString *_Nonnull)key {
    if (!object) {
        return;
    }

    if (object == [NSNull class] || object == NULL) {
        return;
    }

    if (!key) {
        return;
    }

    if ([key stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]].length == 0) {
        return;
    }

    [self setObject:object forKey:key];
}
@end
